From f3ed498c5b15c7c6ad9768c817f981f29463fae8 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 15 May 2011 13:24:10 +0200 Subject: [PATCH] reftests: Add a test for descendant CSS selectors match In widget hierarchy like "Foo Bar Bar Baz", we want the selector "Foo > Bar Baz" to match, because it matches the elements 1, 2 and 4. Previously, the selector only matches the Bar at position 3 and then failed because it wasn't preceded by a Foo. --- tests/reftests/Makefile.am | 3 ++ tests/reftests/css-match-descendant-later.css | 11 +++++ .../css-match-descendant-later.ref.ui | 19 ++++++++ tests/reftests/css-match-descendant-later.ui | 43 +++++++++++++++++++ 4 files changed, 76 insertions(+) create mode 100644 tests/reftests/css-match-descendant-later.css create mode 100644 tests/reftests/css-match-descendant-later.ref.ui create mode 100644 tests/reftests/css-match-descendant-later.ui diff --git a/tests/reftests/Makefile.am b/tests/reftests/Makefile.am index ab86b85097..216888507c 100644 --- a/tests/reftests/Makefile.am +++ b/tests/reftests/Makefile.am @@ -32,6 +32,9 @@ EXTRA_DIST += \ css-match-class.css \ css-match-class.ref.ui \ css-match-class.ui \ + css-match-descendant-later.css \ + css-match-descendant-later.ref.ui \ + css-match-descendant-later.ui \ css-match-name.css \ css-match-name.ref.ui \ css-match-name.ui \ diff --git a/tests/reftests/css-match-descendant-later.css b/tests/reftests/css-match-descendant-later.css new file mode 100644 index 0000000000..421b6d40ae --- /dev/null +++ b/tests/reftests/css-match-descendant-later.css @@ -0,0 +1,11 @@ +GtkEventBox { + background-color: blue +} + +GtkGrid GtkEventBox { + background-color: red +} + +GtkWindow > GtkGrid GtkEventBox { + background-color: blue +} diff --git a/tests/reftests/css-match-descendant-later.ref.ui b/tests/reftests/css-match-descendant-later.ref.ui new file mode 100644 index 0000000000..1afc99baa6 --- /dev/null +++ b/tests/reftests/css-match-descendant-later.ref.ui @@ -0,0 +1,19 @@ + + + + + False + popup + + + 10 + 10 + True + False + + + + + + + diff --git a/tests/reftests/css-match-descendant-later.ui b/tests/reftests/css-match-descendant-later.ui new file mode 100644 index 0000000000..68c8f58645 --- /dev/null +++ b/tests/reftests/css-match-descendant-later.ui @@ -0,0 +1,43 @@ + + + + + False + popup + + + True + False + + + True + False + + + 10 + 10 + True + False + + + + + + 0 + 0 + 1 + 1 + + + + + 0 + 0 + 1 + 1 + + + + + + -- 2.30.2